<template>

  <h1>父组件</h1>
  <son :info="info" :obj="obj" :msg="msg">
    <ul>
      <li>{{info}}</li>
    </ul>
  </son>
</template>

<script lang="ts">
import { defineComponent,ref,reactive, provide } from 'vue';
import Son from './components/Son.vue';


export default defineComponent({
  // name: 'App',
  setup() {
    const info = ref('出太阳了');
    provide("info",info);
    const obj = reactive({
      name:'lili',
      age:20,
    });
    function foo() {
      console.log(info);
      console.log('emit 第二个事件');
      
      
    }
    const msg = ref('就是不下雪');
    function fun(value:string) {
      console.log('复习￥emit自定义事件');
      console.log(info.value + value);
      
      
    }
    return {
      info,
      obj,
      foo,
      msg,
    };
  },
  components: {
    Son,
  },
});
</script>

<style>

</style>
